<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>背景</title>
    <style>
        body {
            margin: 0;
            height: 10000px;
        }

        .box {
            width: 400px;
            height: 400px;
            outline: 1px solid red;
        }

        .b1 {
            background-image: url(./img/vanGogh.jpg);
            background-repeat: no-repeat;
        }

        .b2 {
            width: 800px;
            height: 800px;
            background-image: url(./img/w1.jpg);
            background-size: contain;
            background-repeat: no-repeat;
        }

        .b3 {
            width: 800px;
            height: 400px;
            background-image: url(./img/w1.jpg);
            background-size: contain;
            background-repeat: no-repeat;
        }

        .b4 {
            width: 800px;
            height: 400px;
            background-image: url(./img/w1.jpg);
            background-size: cover;

        }

        .b5 {
            width: 800px;
            height: 800px;
            background-image: url(./img/w1.jpg);
            background-size: cover;

        }

        .b6 {
            width: 800px;
            height: 800px;
            background-image: url(./img/w1.jpg);
            background-size: 200px auto;
            background-repeat: no-repeat;
            background-position: 780px 100%;
            /* right left top bottom center middle */
        }

        .a {
            width: 50px;
            height: 50px;
            outline: 1px solid green;
        }

        .a1 {
            background-image: url(./img/sp.png);
            background-repeat: no-repeat;
            background-position: 20px 10px;
        }

        .a2 {
            background-image: url(./img/sp.png);
            background-repeat: no-repeat;
            background-position: 20px -30px;
        }

        .a3 {
            background-image: url(./img/sp.png);
            background-repeat: no-repeat;
            background-position: 20px -80px;
        }

        .fixed {
            height: 600px;
            outline: 1px solid red;
            background-image: url(./img/w2.jpg);
            background-attachment: fixed;
            background-size: 100% auto;
        }

        .fixed2 {
            height: 600px;
            outline: 1px solid red;
            margin-top: 1000px;
            background-image: url(./img/w1.jpg);
            background-attachment: fixed;
            background-size: 100% auto;
        }

        .clip {
            height: 600px;
            width: 600px;
            padding: 50px;
            border: 50px solid rgba(102, 255, 0, 0.322);
            outline: 1px solid red;
            margin-top: 200px;
            background-image: url(./img/w1.jpg);
            background-clip: content-box;
            background-size: 100% auto;
        }

        .origin {
            height: 600px;
            width: 600px;
            padding: 50px;
            /* border: 50px solid rgba(102, 255, 0, 0.322); */
            outline: 1px solid red;
            margin-top: 200px;
            /* background-image: url(./img/w1.jpg); */
            /* background-clip: content-box; */
            /* background-size: auto 100%;
            background-origin: content-box;
            background-repeat: no-repeat; */
            /* background: color image repeat attachment (position/size); */
            background: 50% 50%/50% 50% url(./img/w1.jpg) red no-repeat  
       

        }
    </style>
</head>

<body>

    <div class="box b1">

    </div>
    <h2>contain</h2>
    <div class="box b2">

    </div>
    <h2>contain</h2>
    <div class="box b3">

    </div>
    <h2>cover</h2>
    <div class="box b4">

    </div>
    <div class="box b5">

    </div>
    <h2>背景定位</h2>
    <div class="box b6">

    </div>
    <div class="box">
        <div class="a a1"></div>
        <div class="a a2"></div>
        <div class="a a3"></div>
    </div>
    <div class="fixed"></div>
    <div class="fixed2"></div>
    <div class="clip">

    </div>
    <h2>origin</h2>
    <div class="origin">

    </div>
</body>

</html>